cannot pr after i push #160951
-
Select Topic AreaQuestion Bodyi'm trying to create a pull request on GitHub, but the 'Compare & pull request' button isn't showing up after I push my branch. The branch exists on my fork, and I've pushed my changes. Why might this happen?" |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This usually happens when your branch isn't based on the latest commit history of the upstream repository. If your fork is significantly behind the original repository (the upstream), or if your branch doesn’t share a common ancestor with the base branch, GitHub can’t generate a valid comparison for a PR. To resolve this: First, sync your fork with the upstream: bash bash |
Beta Was this translation helpful? Give feedback.
This usually happens when your branch isn't based on the latest commit history of the upstream repository. If your fork is significantly behind the original repository (the upstream), or if your branch doesn’t share a common ancestor with the base branch, GitHub can’t generate a valid comparison for a PR.
To resolve this:
First, sync your fork with the upstream:
bash
Copy
Edit
git remote add upstream https://github.com/original/repo.git
git fetch upstream
git rebase upstream/main # or merge, depending on the project's policy
Push the updated branch:
bash
Copy
Edit
git push -f origin your-branch
Now GitHub should recognize the shared history and allow the pull request